/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.schmitt.marc.msRetailManager.persistence;

import de.schmitt.marc.msRetailManager.api.PersistableObject;
import de.schmitt.marc.msRetailManager.api.Persistence;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
import sun.net.util.URLUtil;

/**
 *
 * @author mschmitt
 */
public class DummyPersistence implements Persistence{

    private File persistenceFolder;
    
    @Override
    public List<PersistableObject> loadObjects(Class<PersistableObject> persistable) {
        List<PersistableObject> ret = new LinkedList<PersistableObject>();
        try{
            
            String filename = persistenceFolder.getCanonicalPath()+File.pathSeparator+persistable.getName();
            File file = new File(filename);
            if(file.canRead())
            {   
                BufferedReader reader = new BufferedReader(new FileReader(file));
                String line = reader.readLine();
                
                
            }
        }
        catch (Exception e )
        {
            
        }
        return ret;
    }

    @Override
    public void saveObjects(List<PersistableObject> list) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    
    
    
    
}
